home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: manpage-sample.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 64 6f 63 75 6d 65 6e | 74 73 74 79 6c 65 5b 31 |\documen|tstyle[1|
|00000010| 31 70 74 2c 74 77 6f 73 | 69 64 65 2c 6d 61 6e 70 |1pt,twos|ide,manp|
|00000020| 61 67 65 5d 7b 72 65 70 | 6f 72 74 7d 0a 5c 62 65 |age]{rep|ort}.\be|
|00000030| 67 69 6e 7b 64 6f 63 75 | 6d 65 6e 74 7d 0a 0a 5c |gin{docu|ment}..\|
|00000040| 64 61 74 65 7b 4e 6f 76 | 65 6d 62 65 72 20 32 35 |date{Nov|ember 25|
|00000050| 2c 20 31 39 39 30 7d 0a | 0a 5c 62 65 67 69 6e 7b |, 1990}.|.\begin{|
|00000060| 74 69 74 6c 65 70 61 67 | 65 7d 0a 20 20 20 20 5c |titlepag|e}. \|
|00000070| 76 73 70 61 63 65 2a 7b | 31 2e 30 69 6e 7d 0a 20 |vspace*{|1.0in}. |
|00000080| 20 20 20 5c 62 65 67 69 | 6e 7b 66 6c 75 73 68 72 | \begi|n{flushr|
|00000090| 69 67 68 74 7d 0a 20 20 | 20 20 20 20 20 20 20 20 |ight}. | |
|000000a0| 7b 5c 68 75 67 65 5c 62 | 66 20 4f 49 4d 20 43 2b |{\huge\b|f OIM C+|
|000000b0| 2b 20 4c 69 62 72 61 72 | 79 7d 20 5c 5c 5b 2e 32 |+ Librar|y} \\[.2|
|000000c0| 35 63 6d 5d 0a 20 20 20 | 20 20 20 20 20 20 20 7b |5cm]. | {|
|000000d0| 5c 72 75 6c 65 5b 2e 31 | 69 6e 5d 7b 34 2e 35 69 |\rule[.1|in]{4.5i|
|000000e0| 6e 7d 7b 2e 30 32 69 6e | 7d 7d 5c 5c 5b 2e 32 35 |n}{.02in|}}\\[.25|
|000000f0| 63 6d 5d 0a 20 20 20 20 | 20 20 20 20 20 20 7b 5c |cm]. | {\|
|00000100| 6c 61 72 67 65 5c 62 66 | 20 52 65 66 65 72 65 6e |large\bf| Referen|
|00000110| 63 65 20 4d 61 6e 75 61 | 6c 7d 20 5c 5c 5b 32 2e |ce Manua|l} \\[2.|
|00000120| 30 63 6d 5d 0a 20 20 20 | 20 20 20 20 20 20 20 7b |0cm]. | {|
|00000130| 5c 6c 61 72 67 65 5c 62 | 66 20 56 65 72 73 69 6f |\large\b|f Versio|
|00000140| 6e 20 31 2e 30 7d 20 5c | 5c 5b 34 2e 30 63 6d 5d |n 1.0} \|\[4.0cm]|
|00000150| 0a 20 20 20 20 20 20 20 | 20 20 20 7b 5c 62 66 20 |. | {\bf |
|00000160| 52 6f 6e 67 20 43 68 65 | 6e 7d 5c 5c 0a 20 20 20 |Rong Che|n}\\. |
|00000170| 20 20 20 20 20 20 20 7b | 5c 62 66 20 4a 75 6e 73 | {|\bf Juns|
|00000180| 68 65 6e 67 20 4c 6f 6e | 67 7d 5c 5c 5b 31 2e 30 |heng Lon|g}\\[1.0|
|00000190| 63 6d 5d 0a 20 20 20 20 | 20 20 20 20 20 20 7b 52 |cm]. | {R|
|000001a0| 65 73 65 61 72 63 68 20 | 53 65 72 76 69 63 65 73 |esearch |Services|
|000001b0| 7d 5c 5c 0a 20 20 20 20 | 20 20 20 20 20 20 7b 4f |}\\. | {O|
|000001c0| 66 66 69 63 65 20 66 6f | 72 20 49 6e 66 6f 72 6d |ffice fo|r Inform|
|000001d0| 61 74 69 6f 6e 20 4d 61 | 6e 61 67 65 6d 65 6e 74 |ation Ma|nagement|
|000001e0| 7d 5c 5c 0a 20 20 20 20 | 20 20 20 20 20 20 7b 31 |}\\. | {1|
|000001f0| 34 30 37 20 57 2e 20 47 | 72 65 67 6f 72 79 20 44 |407 W. G|regory D|
|00000200| 72 69 76 65 7d 5c 5c 0a | 20 20 20 20 20 20 20 20 |rive}\\.| |
|00000210| 20 20 7b 55 72 62 61 6e | 61 2c 20 49 4c 20 36 31 | {Urban|a, IL 61|
|00000220| 38 30 31 7d 5c 5c 0a 20 | 20 20 20 20 20 20 20 20 |801}\\. | |
|00000230| 20 7b 28 32 31 37 29 2d | 2d 32 34 34 2d 2d 38 35 | {(217)-|-244--85|
|00000240| 33 38 7d 5c 5c 0a 20 20 | 20 20 5c 65 6e 64 7b 66 |38}\\. | \end{f|
|00000250| 6c 75 73 68 72 69 67 68 | 74 7d 0a 5c 65 6e 64 7b |lushrigh|t}.\end{|
|00000260| 74 69 74 6c 65 70 61 67 | 65 7d 0a 0a 5c 70 61 67 |titlepag|e}..\pag|
|00000270| 65 6e 75 6d 62 65 72 69 | 6e 67 7b 72 6f 6d 61 6e |enumberi|ng{roman|
|00000280| 7d 0a 5c 74 61 62 6c 65 | 6f 66 63 6f 6e 74 65 6e |}.\table|ofconten|
|00000290| 74 73 0a 0a 5c 63 68 61 | 70 74 65 72 2a 7b 50 72 |ts..\cha|pter*{Pr|
|000002a0| 65 66 61 63 65 7d 0a 0a | 54 68 65 20 4f 62 6a 65 |eface}..|The Obje|
|000002b0| 63 74 2d 6f 72 69 65 6e | 74 65 64 20 70 72 6f 62 |ct-orien|ted prob|
|000002c0| 6c 65 6d 20 73 6f 6c 76 | 69 6e 67 20 61 6e 64 20 |lem solv|ing and |
|000002d0| 6f 62 6a 65 63 74 2d 6f | 72 69 65 6e 74 65 64 20 |object-o|riented |
|000002e0| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 0a 72 65 70 |programm|ing .rep|
|000002f0| 72 65 73 65 6e 74 20 61 | 20 77 61 79 20 6f 66 20 |resent a| way of |
|00000300| 74 68 69 6e 6b 69 6e 67 | 20 61 6e 64 20 61 20 6d |thinking| and a m|
|00000310| 65 74 68 6f 64 6f 6c 6f | 67 79 20 66 6f 72 20 63 |ethodolo|gy for c|
|00000320| 6f 6d 70 75 74 65 72 0a | 70 72 6f 67 72 61 6d 6d |omputer.|programm|
|00000330| 69 6e 67 20 74 68 61 74 | 20 61 72 65 20 71 75 69 |ing that| are qui|
|00000340| 74 65 20 64 69 66 66 65 | 72 65 6e 74 20 66 72 6f |te diffe|rent fro|
|00000350| 6d 20 74 68 65 20 74 72 | 61 64 69 74 69 6f 6e 61 |m the tr|aditiona|
|00000360| 6c 20 61 70 70 72 6f 61 | 63 68 65 73 20 0a 73 75 |l approa|ches .su|
|00000370| 70 70 6f 72 74 65 64 20 | 62 79 20 73 74 72 75 63 |pported |by struc|
|00000380| 74 75 72 65 64 20 70 72 | 6f 67 72 61 6d 6d 69 6e |tured pr|ogrammin|
|00000390| 67 20 6c 61 6e 67 75 61 | 67 65 73 2e 20 54 68 65 |g langua|ges. The|
|000003a0| 20 70 6f 77 65 72 66 75 | 6c 20 0a 66 65 61 74 75 | powerfu|l .featu|
|000003b0| 72 65 73 20 6f 66 20 6f | 62 6a 65 63 74 2d 6f 72 |res of o|bject-or|
|000003c0| 69 65 6e 74 65 64 20 70 | 72 6f 67 72 61 6d 6d 69 |iented p|rogrammi|
|000003d0| 6e 67 20 73 75 70 70 6f | 72 74 20 74 68 65 20 63 |ng suppo|rt the c|
|000003e0| 6f 6e 63 65 70 74 73 20 | 74 68 61 74 20 0a 6d 61 |oncepts |that .ma|
|000003f0| 6b 65 20 63 6f 6d 70 75 | 74 65 72 20 70 72 6f 62 |ke compu|ter prob|
|00000400| 6c 65 6d 20 73 6f 6c 76 | 69 6e 67 20 61 20 6d 6f |lem solv|ing a mo|
|00000410| 72 65 20 68 75 6d 61 6e | 2d 6c 69 6b 65 20 61 63 |re human|-like ac|
|00000420| 74 69 76 69 74 79 20 61 | 6e 64 20 0a 74 68 61 74 |tivity a|nd .that|
|00000430| 20 69 6e 63 72 65 61 73 | 65 20 74 68 65 20 72 65 | increas|e the re|
|00000440| 2d 75 73 61 62 69 6c 69 | 74 79 20 6f 66 20 73 6f |-usabili|ty of so|
|00000450| 66 74 77 61 72 65 20 63 | 6f 64 65 2e 20 41 73 20 |ftware c|ode. As |
|00000460| 6f 62 6a 65 63 74 2d 6f | 72 69 65 6e 74 65 64 0a |object-o|riented.|
|00000470| 6c 61 6e 67 75 61 67 65 | 73 20 61 72 65 20 73 74 |language|s are st|
|00000480| 65 61 64 69 6c 79 20 61 | 76 61 69 6c 61 62 6c 65 |eadily a|vailable|
|00000490| 2c 20 6f 62 6a 65 63 74 | 2d 6f 72 69 65 6e 74 65 |, object|-oriente|
|000004a0| 64 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 0a 62 65 |d progra|mming.be|
|000004b0| 63 6f 6d 65 73 20 6d 6f | 72 65 20 61 6e 64 20 6d |comes mo|re and m|
|000004c0| 6f 72 65 20 70 6f 70 75 | 6c 61 72 20 61 6d 6f 6e |ore popu|lar amon|
|000004d0| 67 20 62 6f 74 68 20 73 | 79 73 74 65 6d 20 64 65 |g both s|ystem de|
|000004e0| 76 65 6c 6f 70 65 72 73 | 20 0a 61 6e 64 20 61 70 |velopers| .and ap|
|000004f0| 70 6c 69 63 61 74 69 6f | 6e 20 70 72 6f 67 72 61 |plicatio|n progra|
|00000500| 6d 6d 65 72 73 2e 0a 0a | 43 2b 2b 20 69 73 20 61 |mmers...|C++ is a|
|00000510| 20 68 79 62 72 69 64 20 | 6c 61 6e 67 75 61 67 65 | hybrid |language|
|00000520| 20 74 68 61 74 20 66 75 | 73 65 73 20 6f 62 6a 65 | that fu|ses obje|
|00000530| 63 74 2d 6f 72 69 65 6e | 74 65 64 20 66 75 6e 63 |ct-orien|ted func|
|00000540| 74 69 6f 6e 61 6c 69 74 | 79 0a 77 69 74 68 20 74 |tionalit|y.with t|
|00000550| 68 65 20 66 65 61 74 75 | 72 65 73 20 6f 66 20 61 |he featu|res of a|
|00000560| 20 74 72 61 64 69 74 69 | 6f 6e 61 6c 20 61 6e 64 | traditi|onal and|
|00000570| 20 65 66 66 69 63 69 65 | 6e 74 20 73 74 72 75 63 | efficie|nt struc|
|00000580| 74 75 72 65 64 20 6c 61 | 6e 67 75 61 67 65 2c 20 |tured la|nguage, |
|00000590| 43 2e 20 0a 43 2b 2b 20 | 70 72 6f 76 69 64 65 73 |C. .C++ |provides|
|000005a0| 20 70 72 6f 67 72 61 6d | 6d 65 72 73 20 61 6e 64 | program|mers and|
|000005b0| 20 70 72 6f 62 6c 65 6d | 20 73 6f 6c 76 65 72 73 | problem| solvers|
|000005c0| 20 6f 62 6a 65 63 74 2d | 6f 72 69 65 6e 74 65 64 | object-|oriented|
|000005d0| 20 63 61 70 61 62 69 6c | 69 74 79 0a 77 69 74 68 | capabil|ity.with|
|000005e0| 6f 75 74 20 6c 6f 73 73 | 20 6f 66 20 72 75 6e 2d |out loss| of run-|
|000005f0| 74 69 6d 65 20 6f 72 20 | 6d 65 6d 6f 72 79 20 65 |time or |memory e|
|00000600| 66 66 69 63 69 65 6e 63 | 79 2e 20 49 6e 20 61 64 |fficienc|y. In ad|
|00000610| 64 69 74 69 6f 6e 2c 0a | 43 2b 2b 20 69 73 20 61 |dition,.|C++ is a|
|00000620| 76 61 69 6c 61 62 6c 65 | 20 69 6e 20 61 6c 6d 6f |vailable| in almo|
|00000630| 73 74 20 65 76 65 72 79 | 20 63 6f 6d 70 75 74 65 |st every| compute|
|00000640| 72 20 73 79 73 74 65 6d | 73 20 66 72 6f 6d 20 50 |r system|s from P|
|00000650| 43 20 74 6f 20 6d 61 69 | 6e 66 72 61 6d 65 2e 0a |C to mai|nframe..|
|00000660| 0a 5c 6e 65 77 70 61 67 | 65 0a 0a 5c 72 61 67 67 |.\newpag|e..\ragg|
|00000670| 65 64 62 6f 74 74 6f 6d | 0a 5c 70 61 67 65 6e 75 |edbottom|.\pagenu|
|00000680| 6d 62 65 72 69 6e 67 7b | 61 72 61 62 69 63 7d 0a |mbering{|arabic}.|
|00000690| 5c 70 61 67 65 73 74 79 | 6c 65 7b 68 65 61 64 69 |\pagesty|le{headi|
|000006a0| 6e 67 73 7d 0a 5c 63 68 | 61 70 74 65 72 2a 7b 43 |ngs}.\ch|apter*{C|
|000006b0| 6c 61 73 73 20 44 65 73 | 63 72 69 70 74 69 6f 6e |lass Des|cription|
|000006c0| 73 7d 0a 0a 5c 62 65 67 | 69 6e 7b 6d 61 6e 70 61 |s}..\beg|in{manpa|
|000006d0| 67 65 7d 7b 4f 49 4d 20 | 43 2b 2b 20 4c 69 62 72 |ge}{OIM |C++ Libr|
|000006e0| 61 72 79 7d 7b 43 68 6f | 69 63 65 7d 7b 56 65 72 |ary}{Cho|ice}{Ver|
|000006f0| 73 69 6f 6e 20 31 2e 30 | 7d 0a 0a 5c 73 75 62 74 |sion 1.0|}..\subt|
|00000700| 69 74 6c 65 7b 4e 61 6d | 65 7d 0a 20 20 20 20 43 |itle{Nam|e}. C|
|00000710| 68 6f 69 63 65 20 2d 2d | 2d 20 61 20 73 65 74 20 |hoice --|- a set |
|00000720| 6f 66 20 62 6f 78 65 73 | 20 72 65 70 72 65 73 65 |of boxes| represe|
|00000730| 6e 74 69 6e 67 20 74 68 | 65 20 63 68 6f 69 63 65 |nting th|e choice|
|00000740| 73 20 61 76 61 69 6c 61 | 62 6c 65 2e 20 0a 0a 5c |s availa|ble. ..\|
|00000750| 73 75 62 74 69 74 6c 65 | 7b 44 65 63 6c 61 72 61 |subtitle|{Declara|
|00000760| 74 69 6f 6e 7d 0a 20 20 | 20 20 5c 23 69 6e 63 6c |tion}. | \#incl|
|00000770| 75 64 65 20 5c 3c 63 68 | 6f 69 63 65 2e 68 5c 3e |ude \<ch|oice.h\>|
|00000780| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 43 68 6f 69 |..\funct|ion{Choi|
|00000790| 63 65 28 50 6f 69 6e 74 | 20 6f 72 69 67 69 6e 2c |ce(Point| origin,|
|000007a0| 20 50 6f 69 6e 74 20 63 | 6f 72 6e 65 72 2c 0a 09 | Point c|orner,..|
|000007b0| 09 69 6e 74 20 66 6f 72 | 65 67 72 6f 75 6e 64 5f |.int for|eground_|
|000007c0| 63 6f 6c 6f 72 2c 20 69 | 6e 74 20 62 61 63 6b 67 |color, i|nt backg|
|000007d0| 72 6f 75 6e 64 5f 63 6f | 6c 6f 72 2c 0a 09 09 69 |round_co|lor,...i|
|000007e0| 6e 74 20 66 72 61 6d 65 | 5f 73 74 79 6c 65 2c 20 |nt frame|_style, |
|000007f0| 69 6e 74 20 73 70 61 63 | 65 5f 69 6e 5f 62 65 74 |int spac|e_in_bet|
|00000800| 77 65 65 6e 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |ween,. | |
|00000810| 20 20 20 20 20 20 69 6e | 74 20 6e 75 6d 62 65 72 | in|t number|
|00000820| 5f 6f 66 5f 63 68 6f 69 | 63 65 73 2c 0a 20 20 20 |_of_choi|ces,. |
|00000830| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 63 6f 6e | | con|
|00000840| 73 74 7e 63 68 61 72 5c | 2a 20 66 69 72 73 74 5f |st~char\|* first_|
|00000850| 6c 61 62 65 6c 2c 20 24 | 2e 2e 2e 24 20 29 7d 0a |label, $|...$ )}.|
|00000860| 20 20 20 20 43 6f 6e 73 | 74 72 75 63 74 73 20 61 | Cons|tructs a|
|00000870| 20 63 68 6f 69 63 65 20 | 6f 62 6a 65 63 74 2e 20 | choice |object. |
|00000880| 20 45 61 63 68 20 63 68 | 6f 69 63 65 20 6f 62 6a | Each ch|oice obj|
|00000890| 65 63 74 20 69 73 20 61 | 20 73 65 74 20 6f 66 20 |ect is a| set of |
|000008a0| 62 6f 78 65 73 0a 20 20 | 20 20 72 65 70 72 65 73 |boxes. | repres|
|000008b0| 65 6e 74 69 6e 67 20 74 | 68 65 20 63 68 6f 69 63 |enting t|he choic|
|000008c0| 65 73 20 61 76 61 69 6c | 61 62 6c 65 2e 20 20 22 |es avail|able. "|
|000008d0| 4f 72 69 67 69 6e 22 20 | 61 6e 64 20 22 63 6f 72 |Origin" |and "cor|
|000008e0| 6e 65 72 22 20 64 65 66 | 69 6e 65 20 74 68 65 0a |ner" def|ine the.|
|000008f0| 20 20 20 20 72 65 63 74 | 61 6e 67 75 6c 61 72 20 | rect|angular |
|00000900| 61 72 65 61 20 69 6e 73 | 69 64 65 20 77 68 69 63 |area ins|ide whic|
|00000910| 68 20 74 68 65 20 62 6f | 78 65 73 20 61 72 65 20 |h the bo|xes are |
|00000920| 64 69 73 70 6c 61 79 65 | 64 2e 20 0a 20 20 20 20 |displaye|d. . |
|00000930| 54 68 65 20 22 73 70 61 | 63 65 5f 69 6e 5f 62 65 |The "spa|ce_in_be|
|00000940| 74 77 65 65 6e 22 20 28 | 69 6e 20 70 69 78 65 6c |tween" (|in pixel|
|00000950| 73 29 0a 20 20 20 20 64 | 65 66 69 6e 65 73 20 74 |s). d|efines t|
|00000960| 68 65 20 64 69 73 74 61 | 6e 63 65 20 62 65 74 77 |he dista|nce betw|
|00000970| 65 65 6e 20 74 77 6f 20 | 61 64 6a 61 63 65 6e 74 |een two |adjacent|
|00000980| 20 62 6f 78 65 73 2e 20 | 20 44 65 70 65 6e 64 69 | boxes. | Dependi|
|00000990| 6e 67 20 6f 6e 20 0a 20 | 20 20 20 77 68 65 74 68 |ng on . | wheth|
|000009a0| 65 72 20 74 68 65 72 65 | 20 69 73 20 65 6e 6f 75 |er there| is enou|
|000009b0| 67 68 20 72 6f 6f 6d 20 | 74 6f 20 70 75 74 20 61 |gh room |to put a|
|000009c0| 6c 6c 20 74 68 65 20 63 | 68 6f 69 63 65 73 20 68 |ll the c|hoices h|
|000009d0| 6f 72 69 7a 6f 6e 74 61 | 6c 6c 79 0a 20 20 20 20 |orizonta|lly. |
|000009e0| 6f 72 20 76 65 72 74 69 | 63 61 6c 6c 79 20 69 6e |or verti|cally in|
|000009f0| 20 74 68 65 20 64 65 73 | 69 67 6e 61 74 65 64 20 | the des|ignated |
|00000a00| 61 72 65 61 2c 0a 20 20 | 20 20 74 68 65 20 63 68 |area,. | the ch|
|00000a10| 6f 69 63 65 73 20 77 69 | 6c 6c 20 62 65 20 6c 61 |oices wi|ll be la|
|00000a20| 69 64 20 6f 75 74 20 61 | 63 63 6f 72 64 69 6e 67 |id out a|ccording|
|00000a30| 6c 79 2e 20 20 54 68 65 | 0a 20 20 20 20 61 74 74 |ly. The|. att|
|00000a40| 72 69 62 75 74 65 73 20 | 22 66 6f 72 65 67 72 6f |ributes |"foregro|
|00000a50| 75 6e 64 5f 63 6f 6c 6f | 72 22 2c 20 22 62 61 63 |und_colo|r", "bac|
|00000a60| 6b 67 72 6f 75 6e 64 5f | 63 6f 6c 6f 72 22 20 61 |kground_|color" a|
|00000a70| 6e 64 20 22 66 72 61 6d | 65 5f 73 74 79 6c 65 22 |nd "fram|e_style"|
|00000a80| 0a 20 20 20 20 64 65 66 | 69 6e 65 20 74 68 65 20 |. def|ine the |
|00000a90| 63 6f 6c 6f 72 73 20 66 | 6f 72 20 65 61 63 68 20 |colors f|or each |
|00000aa0| 62 6f 78 20 74 68 61 74 | 20 72 65 70 72 65 73 65 |box that| represe|
|00000ab0| 6e 74 73 20 65 61 63 68 | 20 63 68 6f 69 63 65 2e |nts each| choice.|
|00000ac0| 0a 20 20 20 20 54 68 65 | 20 6e 75 6d 62 65 72 20 |. The| number |
|00000ad0| 6f 66 20 6c 61 62 65 6c | 73 20 73 74 61 72 74 69 |of label|s starti|
|00000ae0| 6e 67 20 77 69 74 68 20 | 22 66 69 72 73 74 5f 6c |ng with |"first_l|
|00000af0| 61 62 65 6c 22 20 6d 75 | 73 74 20 6d 61 74 63 68 |abel" mu|st match|
|00000b00| 20 74 68 65 0a 20 20 20 | 20 6e 75 6d 62 65 72 20 | the. | number |
|00000b10| 67 69 76 65 6e 20 62 79 | 20 22 6e 75 6d 62 65 72 |given by| "number|
|00000b20| 5f 6f 66 5f 63 68 6f 69 | 63 65 73 22 2e 20 20 45 |_of_choi|ces". E|
|00000b30| 61 63 68 20 6c 61 62 65 | 6c 20 69 73 20 64 69 73 |ach labe|l is dis|
|00000b40| 70 6c 61 79 65 64 20 77 | 69 74 68 69 6e 0a 20 20 |played w|ithin. |
|00000b50| 20 20 69 74 73 20 63 6f | 72 72 65 73 70 6f 6e 64 | its co|rrespond|
|00000b60| 69 6e 67 20 62 6f 78 2e | 20 20 54 68 65 20 63 68 |ing box.| The ch|
|00000b70| 6f 69 63 65 73 20 61 72 | 65 20 64 69 73 70 6c 61 |oices ar|e displa|
|00000b80| 79 65 64 20 0a 20 20 20 | 20 61 73 20 73 6f 6f 6e |yed . | as soon|
|00000b90| 20 61 73 20 74 68 65 79 | 20 61 72 65 20 63 72 65 | as they| are cre|
|00000ba0| 61 74 65 64 2e 0a 0a 5c | 66 75 6e 63 74 69 6f 6e |ated...\|function|
|00000bb0| 7b 43 68 6f 69 63 65 28 | 69 6e 74 20 6e 75 6d 62 |{Choice(|int numb|
|00000bc0| 65 72 5f 6f 66 5f 63 68 | 6f 69 63 65 73 2c 20 42 |er_of_ch|oices, B|
|00000bd0| 6f 6f 6c 65 61 6e 20 69 | 73 5f 68 6f 72 69 7a 6f |oolean i|s_horizo|
|00000be0| 6e 74 61 6c 20 3d 20 56 | 45 52 54 49 43 41 4c 29 |ntal = V|ERTICAL)|
|00000bf0| 7d 0a 20 20 20 20 43 6f | 6e 73 74 72 75 63 74 73 |}. Co|nstructs|
|00000c00| 20 61 6e 20 61 72 72 61 | 79 20 6f 66 20 63 68 6f | an arra|y of cho|
|00000c10| 69 63 65 73 20 6f 72 20 | 0a 20 20 20 20 61 20 63 |ices or |. a c|
|00000c20| 68 6f 69 63 65 20 6f 62 | 6a 65 63 74 20 77 69 74 |hoice ob|ject wit|
|00000c30| 68 20 62 6f 78 65 73 20 | 6f 66 20 64 69 66 66 65 |h boxes |of diffe|
|00000c40| 72 65 6e 74 20 73 69 7a | 65 73 2e 20 20 54 68 65 |rent siz|es. The|
|00000c50| 20 61 74 74 72 69 62 75 | 74 65 73 0a 20 20 20 20 | attribu|tes. |
|00000c60| 6f 66 20 74 68 65 20 61 | 63 74 75 61 6c 20 63 68 |of the a|ctual ch|
|00000c70| 6f 69 63 65 73 20 77 69 | 6c 6c 20 62 65 20 64 65 |oices wi|ll be de|
|00000c80| 66 69 6e 65 64 20 6c 61 | 74 65 72 20 75 73 69 6e |fined la|ter usin|
|00000c90| 67 20 74 68 65 0a 20 20 | 20 20 61 64 64 49 74 65 |g the. | addIte|
|00000ca0| 6d 28 29 20 6f 70 65 72 | 61 74 69 6f 6e 2e 20 4e |m() oper|ation. N|
|00000cb0| 6f 74 65 3a 20 49 74 20 | 69 73 20 66 6f 72 62 69 |ote: It |is forbi|
|00000cc0| 64 64 65 6e 20 74 6f 20 | 68 61 76 65 20 61 72 67 |dden to |have arg|
|00000cd0| 75 6d 65 6e 74 73 0a 20 | 20 20 20 69 6e 20 74 68 |uments. | in th|
|00000ce0| 65 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 73 20 6f |e constr|uctors o|
|00000cf0| 66 20 61 72 72 61 79 20 | 6f 62 6a 65 63 74 73 20 |f array |objects |
|00000d00| 69 6e 20 43 2b 2b 2e 20 | 0a 0a 5c 66 75 6e 63 74 |in C++. |..\funct|
|00000d10| 69 6f 6e 7b 5c 7e 43 68 | 6f 69 63 65 28 29 7d 0a |ion{\~Ch|oice()}.|
|00000d20| 20 20 20 20 43 68 6f 69 | 63 65 20 63 6c 61 73 73 | Choi|ce class|
|00000d30| 20 68 61 73 20 61 6e 20 | 65 6d 70 74 79 20 64 65 | has an |empty de|
|00000d40| 73 74 72 75 63 74 6f 72 | 2e 0a 0a 5c 73 75 62 74 |structor|...\subt|
|00000d50| 69 74 6c 65 7b 44 65 73 | 63 72 69 70 74 69 6f 6e |itle{Des|cription|
|00000d60| 7d 0a 20 20 20 20 41 20 | 43 68 6f 69 63 65 20 6f |}. A |Choice o|
|00000d70| 62 6a 65 63 74 20 69 73 | 20 61 20 73 65 74 20 6f |bject is| a set o|
|00000d80| 66 20 72 65 6c 61 74 65 | 64 20 62 6f 78 65 73 2e |f relate|d boxes.|
|00000d90| 20 49 74 20 69 73 20 75 | 73 65 64 20 74 6f 20 64 | It is u|sed to d|
|00000da0| 69 73 70 6c 61 79 0a 20 | 20 20 20 6d 75 6c 74 69 |isplay. | multi|
|00000db0| 70 6c 65 20 63 68 6f 69 | 63 65 73 20 6f 6e 20 74 |ple choi|ces on t|
|00000dc0| 68 65 20 73 63 72 65 65 | 6e 2e 20 0a 20 20 20 20 |he scree|n. . |
|00000dd0| 41 20 63 68 6f 69 63 65 | 20 6d 61 79 20 65 69 74 |A choice| may eit|
|00000de0| 68 65 72 20 62 65 20 73 | 65 6c 65 63 74 65 64 20 |her be s|elected |
|00000df0| 62 79 20 70 72 65 73 73 | 69 6e 67 20 61 20 68 6f |by press|ing a ho|
|00000e00| 74 20 6b 65 79 0a 20 20 | 20 20 28 77 68 65 6e 20 |t key. | (when |
|00000e10| 6d 6f 75 73 65 20 69 73 | 20 6e 6f 74 20 65 6e 61 |mouse is| not ena|
|00000e20| 62 6c 65 64 29 20 6f 72 | 20 62 79 20 70 72 65 73 |bled) or| by pres|
|00000e30| 73 69 6e 67 20 61 20 6d | 6f 75 73 65 20 62 75 74 |sing a m|ouse but|
|00000e40| 74 6f 6e 20 77 68 65 6e | 20 74 68 65 20 6d 6f 75 |ton when| the mou|
|00000e50| 73 65 0a 20 20 20 20 63 | 75 72 73 6f 72 20 69 73 |se. c|ursor is|
|00000e60| 20 77 69 74 68 69 6e 20 | 74 68 65 20 69 6e 74 65 | within |the inte|
|00000e70| 6e 64 65 64 20 63 68 6f | 69 63 65 20 62 6f 78 2e |nded cho|ice box.|
|00000e80| 20 20 0a 20 20 20 20 54 | 68 65 20 66 69 72 73 74 | . T|he first|
|00000e90| 20 68 69 67 68 6c 69 67 | 68 74 65 64 20 63 68 61 | highlig|hted cha|
|00000ea0| 72 61 63 74 65 72 20 69 | 6e 20 74 68 65 20 74 65 |racter i|n the te|
|00000eb0| 78 74 20 6c 61 62 65 6c | 20 77 69 6c 6c 20 62 65 |xt label| will be|
|00000ec0| 20 74 68 65 20 0a 20 20 | 20 20 68 6f 74 20 6b 65 | the . | hot ke|
|00000ed0| 79 20 69 66 20 74 68 65 | 20 6d 6f 75 73 65 20 69 |y if the| mouse i|
|00000ee0| 73 20 6e 6f 74 20 65 6e | 61 62 6c 65 64 2c 20 6f |s not en|abled, o|
|00000ef0| 74 68 65 72 77 69 73 65 | 2c 20 74 68 65 20 68 69 |therwise|, the hi|
|00000f00| 67 68 6c 69 67 68 74 65 | 64 0a 20 20 20 20 63 68 |ghlighte|d. ch|
|00000f10| 61 72 61 63 74 65 72 20 | 77 69 6c 6c 20 68 61 76 |aracter |will hav|
|00000f20| 65 20 6e 6f 20 65 66 66 | 65 63 74 2e 20 46 6f 72 |e no eff|ect. For|
|00000f30| 20 65 78 61 6d 70 6c 65 | 2c 20 6c 61 62 65 6c 20 | example|, label |
|00000f40| 22 40 4e 40 65 78 74 22 | 20 64 65 73 69 67 6e 61 |"@N@ext"| designa|
|00000f50| 74 65 73 0a 20 20 20 20 | 22 4e 22 20 61 73 20 74 |tes. |"N" as t|
|00000f60| 68 65 20 68 6f 74 20 6b | 65 79 20 66 6f 72 20 74 |he hot k|ey for t|
|00000f70| 68 65 20 62 75 74 74 6f | 6e 20 69 66 20 74 68 65 |he butto|n if the|
|00000f80| 20 6d 6f 75 73 65 20 69 | 73 20 6e 6f 74 20 65 6e | mouse i|s not en|
|00000f90| 61 62 6c 65 64 2e 0a 20 | 20 20 20 42 79 20 64 65 |abled.. | By de|
|00000fa0| 66 61 75 6c 74 2c 20 69 | 66 20 74 68 65 20 6d 6f |fault, i|f the mo|
|00000fb0| 75 73 65 20 64 72 69 76 | 65 72 20 69 73 20 6c 6f |use driv|er is lo|
|00000fc0| 61 64 65 64 20 62 65 66 | 6f 72 65 20 70 72 6f 67 |aded bef|ore prog|
|00000fd0| 72 61 6d 20 65 78 65 63 | 75 74 69 6f 6e 2c 0a 20 |ram exec|ution,. |
|00000fe0| 20 20 20 74 68 65 20 6d | 6f 75 73 65 20 69 73 20 | the m|ouse is |
|00000ff0| 65 6e 61 62 6c 65 64 2e | 20 20 57 68 65 6e 20 75 |enabled.| When u|
|00001000| 73 69 6e 67 20 74 68 65 | 20 6d 6f 75 73 65 20 74 |sing the| mouse t|
|00001010| 6f 20 73 65 6c 65 63 74 | 0a 20 20 20 20 61 20 63 |o select|. a c|
|00001020| 68 6f 69 63 65 2c 20 74 | 68 65 20 73 65 6c 65 63 |hoice, t|he selec|
|00001030| 74 69 6f 6e 20 69 73 20 | 69 6d 6d 65 64 69 61 74 |tion is |immediat|
|00001040| 65 3b 20 61 20 68 6f 74 | 20 6b 65 79 20 6d 75 73 |e; a hot| key mus|
|00001050| 74 20 62 65 20 63 6f 6e | 66 69 72 6d 65 64 0a 20 |t be con|firmed. |
|00001060| 20 20 20 62 79 20 70 72 | 65 73 73 69 6e 67 20 45 | by pr|essing E|
|00001070| 4e 54 45 52 20 28 63 61 | 72 72 69 61 67 65 20 72 |NTER (ca|rriage r|
|00001080| 65 74 75 72 6e 20 6b 65 | 79 29 2e 20 20 41 72 72 |eturn ke|y). Arr|
|00001090| 6f 77 20 6b 65 79 73 20 | 63 61 6e 20 61 6c 73 6f |ow keys |can also|
|000010a0| 20 62 65 20 75 73 65 64 | 0a 20 20 20 20 74 6f 20 | be used|. to |
|000010b0| 6d 6f 76 65 20 74 68 65 | 20 63 75 72 72 65 6e 74 |move the| current|
|000010c0| 20 73 65 6c 65 63 74 69 | 6f 6e 20 69 6e 20 74 68 | selecti|on in th|
|000010d0| 65 20 64 69 72 65 63 74 | 69 6f 6e 20 69 6e 64 69 |e direct|ion indi|
|000010e0| 63 61 74 65 64 20 62 79 | 20 74 68 65 20 61 72 72 |cated by| the arr|
|000010f0| 6f 77 73 2c 0a 20 20 20 | 20 74 68 69 73 20 61 6c |ows,. | this al|
|00001100| 73 6f 20 72 65 71 75 69 | 72 65 73 20 61 6e 20 45 |so requi|res an E|
|00001110| 4e 54 45 52 20 74 6f 20 | 63 6f 6e 66 69 72 6d 2e |NTER to |confirm.|
|00001120| 0a 0a 5c 73 75 62 74 69 | 74 6c 65 7b 47 6c 6f 62 |..\subti|tle{Glob|
|00001130| 61 6c 20 5c 5c 20 56 61 | 72 69 61 62 6c 65 73 7d |al \\ Va|riables}|
|00001140| 0a 5c 76 61 72 69 61 62 | 6c 65 7b 63 68 61 72 20 |.\variab|le{char |
|00001150| 68 6f 73 74 5f 6e 61 6d | 65 5b 32 30 5d 20 3d 20 |host_nam|e[20] = |
|00001160| 5c 22 72 6f 73 65 2e 63 | 73 2e 75 69 75 63 2e 65 |\"rose.c|s.uiuc.e|
|00001170| 64 75 5c 22 7d 0a 20 20 | 20 20 54 68 65 20 22 68 |du\"}. | The "h|
|00001180| 6f 73 74 5f 6e 61 6d 65 | 22 20 62 75 66 66 65 72 |ost_name|" buffer|
|00001190| 20 69 73 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 20 | is init|ialized |
|000011a0| 74 6f 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6d |to the c|urrent m|
|000011b0| 61 63 68 69 6e 65 20 6e | 61 6d 65 0a 20 20 20 20 |achine n|ame. |
|000011c0| 62 65 66 6f 72 65 20 74 | 68 65 20 6d 61 69 6e 28 |before t|he main(|
|000011d0| 29 20 66 75 6e 63 74 69 | 6f 6e 20 69 73 20 65 78 |) functi|on is ex|
|000011e0| 65 63 75 74 65 64 2e 20 | 20 54 68 65 20 6d 61 63 |ecuted. | The mac|
|000011f0| 68 69 6e 65 20 6e 61 6d | 65 20 69 73 0a 20 20 20 |hine nam|e is. |
|00001200| 20 75 73 75 61 6c 6c 79 | 20 64 65 63 6c 61 72 65 | usually| declare|
|00001210| 64 20 69 6e 20 61 20 44 | 4f 53 20 73 68 65 6c 6c |d in a D|OS shell|
|00001220| 20 76 61 72 69 61 62 6c | 65 20 22 4f 49 4d 55 53 | variabl|e "OIMUS|
|00001230| 45 52 22 2e 0a 0a 5c 76 | 61 72 69 61 62 6c 65 7b |ER"...\v|ariable{|
|00001240| 42 6f 6f 6c 65 61 6e 20 | 6d 6f 75 73 65 5f 69 6e |Boolean |mouse_in|
|00001250| 73 74 61 6c 6c 65 64 7d | 0a 20 20 20 20 42 79 20 |stalled}|. By |
|00001260| 64 65 66 61 75 6c 74 2c | 20 74 68 65 20 22 6d 6f |default,| the "mo|
|00001270| 75 73 65 5f 69 6e 73 74 | 61 6c 6c 65 64 22 20 76 |use_inst|alled" v|
|00001280| 61 72 69 61 62 6c 65 20 | 69 73 20 61 73 73 69 67 |ariable |is assig|
|00001290| 6e 65 64 20 74 6f 20 54 | 52 55 45 20 69 66 0a 20 |ned to T|RUE if. |
|000012a0| 20 20 20 74 68 65 20 6d | 6f 75 73 65 20 64 72 69 | the m|ouse dri|
|000012b0| 76 65 72 20 68 61 73 20 | 62 65 65 6e 20 69 6e 73 |ver has |been ins|
|000012c0| 74 61 6c 6c 65 64 20 62 | 65 66 6f 72 65 20 70 72 |talled b|efore pr|
|000012d0| 6f 67 72 61 6d 20 65 78 | 65 63 75 74 69 6f 6e 3b |ogram ex|ecution;|
|000012e0| 0a 20 20 20 20 6f 74 68 | 65 72 77 69 73 65 20 69 |. oth|erwise i|
|000012f0| 74 20 69 73 20 61 73 73 | 69 67 6e 65 64 20 74 6f |t is ass|igned to|
|00001300| 20 46 41 4c 53 45 2e 20 | 20 54 68 65 20 76 61 6c | FALSE. | The val|
|00001310| 75 65 20 6d 61 79 20 61 | 6c 73 6f 20 62 65 20 63 |ue may a|lso be c|
|00001320| 68 61 6e 67 65 64 0a 20 | 20 20 20 74 68 72 6f 75 |hanged. | throu|
|00001330| 67 68 20 65 6e 61 62 6c | 65 4d 6f 75 73 65 28 29 |gh enabl|eMouse()|
|00001340| 20 61 6e 64 20 64 69 73 | 61 62 6c 65 4d 6f 75 73 | and dis|ableMous|
|00001350| 65 28 29 20 66 75 6e 63 | 74 69 6f 6e 73 2e 0a 0a |e() func|tions...|
|00001360| 5c 73 75 62 74 69 74 6c | 65 7b 4d 61 63 72 6f 73 |\subtitl|e{Macros|
|00001370| 7d 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 4d 41 58 28 |}.\funct|ion{MAX(|
|00001380| 7b 5c 69 74 20 78 7d 2c | 20 7b 5c 69 74 20 79 7d |{\it x},| {\it y}|
|00001390| 29 7d 0a 20 20 20 20 52 | 65 74 75 72 6e 73 20 74 |)}. R|eturns t|
|000013a0| 68 65 20 6d 61 78 69 6d | 75 6d 20 6f 66 20 74 68 |he maxim|um of th|
|000013b0| 65 20 74 77 6f 20 63 6f | 6d 70 61 72 61 62 6c 65 |e two co|mparable|
|000013c0| 20 6f 62 6a 65 63 74 73 | 20 22 78 22 2c 20 61 6e | objects| "x", an|
|000013d0| 64 20 22 79 22 2e 0a 20 | 20 20 20 54 68 69 73 20 |d "y".. | This |
|000013e0| 6d 61 63 72 6f 20 69 73 | 20 6f 66 74 65 6e 20 75 |macro is| often u|
|000013f0| 73 65 64 20 74 6f 20 63 | 6f 6d 70 61 72 65 20 69 |sed to c|ompare i|
|00001400| 6e 74 65 67 65 72 73 20 | 6f 72 20 72 65 61 6c 20 |ntegers |or real |
|00001410| 6e 75 6d 62 65 72 73 2e | 0a 0a 5c 66 75 6e 63 74 |numbers.|..\funct|
|00001420| 69 6f 6e 7b 4d 49 4e 28 | 7b 5c 69 74 20 78 7d 2c |ion{MIN(|{\it x},|
|00001430| 20 7b 5c 69 74 20 79 7d | 29 7d 0a 20 20 20 20 52 | {\it y}|)}. R|
|00001440| 65 74 75 72 6e 73 20 74 | 68 65 20 6d 69 6e 69 6d |eturns t|he minim|
|00001450| 75 6d 20 6f 66 20 74 68 | 65 20 74 77 6f 20 63 6f |um of th|e two co|
|00001460| 6d 70 61 72 61 62 6c 65 | 20 6f 62 6a 65 63 74 73 |mparable| objects|
|00001470| 20 22 78 22 2c 20 61 6e | 64 20 22 79 22 2e 0a 20 | "x", an|d "y".. |
|00001480| 20 20 20 54 68 69 73 20 | 6d 61 63 72 6f 20 69 73 | This |macro is|
|00001490| 20 6f 66 74 65 6e 20 75 | 73 65 64 20 74 6f 20 63 | often u|sed to c|
|000014a0| 6f 6d 70 61 72 65 20 69 | 6e 74 65 67 65 72 73 20 |ompare i|ntegers |
|000014b0| 6f 72 20 72 65 61 6c 20 | 6e 75 6d 62 65 72 73 2e |or real |numbers.|
|000014c0| 0a 0a 5c 73 75 62 74 69 | 74 6c 65 7b 50 75 62 6c |..\subti|tle{Publ|
|000014d0| 69 63 20 5c 5c 20 4f 70 | 65 72 61 74 69 6f 6e 73 |ic \\ Op|erations|
|000014e0| 7d 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 76 6f 69 64 |}.\funct|ion{void|
|000014f0| 20 61 64 64 49 74 65 6d | 28 50 6f 69 6e 74 20 6f | addItem|(Point o|
|00001500| 72 69 67 69 6e 2c 20 50 | 6f 69 6e 74 20 63 6f 72 |rigin, P|oint cor|
|00001510| 6e 65 72 2c 0a 09 09 20 | 69 6e 74 20 66 6f 72 65 |ner,... |int fore|
|00001520| 67 72 6f 75 6e 64 5f 63 | 6f 6c 6f 72 2c 20 69 6e |ground_c|olor, in|
|00001530| 74 20 62 61 63 6b 67 72 | 6f 75 6e 64 5f 63 6f 6c |t backgr|ound_col|
|00001540| 6f 72 2c 0a 09 09 20 69 | 6e 74 20 66 72 61 6d 65 |or,... i|nt frame|
|00001550| 5f 73 74 79 6c 65 2c 20 | 63 6f 6e 73 74 7e 63 68 |_style, |const~ch|
|00001560| 61 72 5c 2a 20 6c 61 62 | 65 6c 2c 0a 09 09 20 69 |ar\* lab|el,... i|
|00001570| 6e 74 20 74 65 78 74 5f | 63 6f 6c 6f 72 20 3d 20 |nt text_|color = |
|00001580| 57 48 49 54 45 2c 0a 09 | 09 20 69 6e 74 20 74 65 |WHITE,..|. int te|
|00001590| 78 74 5f 68 69 67 68 6c | 69 67 68 74 5f 63 6f 6c |xt_highl|ight_col|
|000015a0| 6f 72 20 3d 20 4c 49 47 | 48 54 5f 57 48 49 54 45 |or = LIG|HT_WHITE|
|000015b0| 29 7d 0a 20 20 20 20 44 | 65 66 69 6e 65 73 20 74 |)}. D|efines t|
|000015c0| 68 65 20 61 74 74 72 69 | 62 75 74 65 73 20 6f 66 |he attri|butes of|
|000015d0| 20 61 20 63 68 6f 69 63 | 65 20 62 6f 78 20 69 6e | a choic|e box in|
|000015e0| 20 74 68 65 20 61 72 72 | 61 79 20 64 65 63 6c 61 | the arr|ay decla|
|000015f0| 72 65 64 20 62 79 20 74 | 68 65 0a 20 20 20 20 43 |red by t|he. C|
|00001600| 68 6f 69 63 65 28 69 6e | 74 20 22 6e 75 6d 62 65 |hoice(in|t "numbe|
|00001610| 72 5f 6f 66 5f 63 68 6f | 69 63 65 73 22 2c 20 42 |r_of_cho|ices", B|
|00001620| 6f 6f 6c 65 61 6e 20 22 | 69 73 5f 68 6f 72 69 7a |oolean "|is_horiz|
|00001630| 6f 6e 74 61 6c 22 20 3d | 20 56 45 52 54 49 43 41 |ontal" =| VERTICA|
|00001640| 4c 29 20 0a 20 20 20 20 | 63 6f 6e 73 74 72 75 63 |L) . |construc|
|00001650| 74 6f 72 2e 20 49 74 20 | 6d 75 73 74 20 62 65 20 |tor. It |must be |
|00001660| 63 61 6c 6c 65 64 20 65 | 78 61 63 74 6c 79 20 22 |called e|xactly "|
|00001670| 6e 75 6d 62 65 72 5f 6f | 66 5f 63 68 6f 69 63 65 |number_o|f_choice|
|00001680| 73 22 0a 20 20 20 20 74 | 69 6d 65 73 2e 20 20 54 |s". t|imes. T|
|00001690| 68 65 20 66 69 72 73 74 | 20 63 61 6c 6c 20 73 70 |he first| call sp|
|000016a0| 65 63 69 66 69 65 73 20 | 74 68 65 20 66 69 72 73 |ecifies |the firs|
|000016b0| 74 20 63 68 6f 69 63 65 | 2c 20 73 65 63 6f 6e 64 |t choice|, second|
|000016c0| 20 63 61 6c 6c 20 73 70 | 65 63 69 66 69 65 73 0a | call sp|ecifies.|
|000016d0| 20 20 20 20 74 68 65 20 | 73 65 63 6f 6e 64 20 63 | the |second c|
|000016e0| 68 6f 69 63 65 2c 20 61 | 6e 64 20 73 6f 20 6f 6e |hoice, a|nd so on|
|000016f0| 2e 20 20 54 68 65 20 61 | 74 74 72 69 62 75 74 65 |. The a|ttribute|
|00001700| 73 20 22 6f 72 69 67 69 | 6e 22 20 61 6e 64 20 22 |s "origi|n" and "|
|00001710| 63 6f 72 6e 65 72 22 0a | 20 20 20 20 64 65 66 69 |corner".| defi|
|00001720| 6e 65 20 61 20 62 6f 78 | 20 61 72 65 61 20 77 68 |ne a box| area wh|
|00001730| 65 72 65 20 74 68 65 20 | 63 68 6f 69 63 65 20 69 |ere the |choice i|
|00001740| 74 65 6d 20 69 73 20 6c | 6f 63 61 74 65 64 20 6f |tem is l|ocated o|
|00001750| 6e 20 74 68 65 20 73 63 | 72 65 65 6e 2e 20 20 4f |n the sc|reen. O|
|00001760| 74 68 65 72 0a 20 20 20 | 20 61 74 74 72 69 62 75 |ther. | attribu|
|00001770| 74 65 73 20 61 72 65 20 | 73 65 6c 66 2d 65 78 70 |tes are |self-exp|
|00001780| 6c 61 6e 61 74 6f 72 79 | 2e 20 20 54 68 69 73 20 |lanatory|. This |
|00001790| 63 61 6c 6c 20 69 73 20 | 70 61 72 74 69 63 75 6c |call is |particul|
|000017a0| 61 72 6c 79 20 75 73 65 | 66 75 6c 0a 20 20 20 20 |arly use|ful. |
|000017b0| 6f 6e 20 70 72 6f 67 72 | 61 6d 20 73 65 74 75 70 |on progr|am setup|
|000017c0| 20 70 61 67 65 73 2e 0a | 0a 5c 66 75 6e 63 74 69 | pages..|.\functi|
|000017d0| 6f 6e 7b 42 6f 6f 6c 65 | 61 6e 20 68 61 73 56 61 |on{Boole|an hasVa|
|000017e0| 6c 75 65 28 29 7d 0a 20 | 20 20 20 52 65 74 75 72 |lue()}. | Retur|
|000017f0| 6e 73 20 54 52 55 45 20 | 69 66 20 74 68 65 20 64 |ns TRUE |if the d|
|00001800| 65 73 69 67 6e 61 74 65 | 64 20 63 68 6f 69 63 65 |esignate|d choice|
|00001810| 20 6f 62 6a 65 63 74 20 | 68 61 73 20 62 65 65 6e | object |has been|
|00001820| 20 73 65 6c 65 63 74 65 | 64 20 61 74 0a 20 20 20 | selecte|d at. |
|00001830| 20 6c 65 61 73 74 20 6f | 6e 63 65 2e 20 20 47 72 | least o|nce. Gr|
|00001840| 61 70 68 69 63 61 6c 6c | 79 2c 0a 20 20 20 20 69 |aphicall|y,. i|
|00001850| 74 20 6d 65 61 6e 73 20 | 6f 6e 65 20 6f 66 20 74 |t means |one of t|
|00001860| 68 65 20 63 68 6f 69 63 | 65 73 20 69 73 20 72 65 |he choic|es is re|
|00001870| 6e 64 65 72 65 64 20 69 | 6e 20 72 65 76 65 72 73 |ndered i|n revers|
|00001880| 65 20 63 6f 6c 6f 72 73 | 2e 20 20 49 74 20 69 73 |e colors|. It is|
|00001890| 0a 20 20 20 20 73 6f 6d | 65 74 69 6d 65 73 20 6e |. som|etimes n|
|000018a0| 65 63 65 73 73 61 72 79 | 20 74 6f 20 63 68 65 63 |ecessary| to chec|
|000018b0| 6b 20 69 66 20 61 6c 6c | 20 63 68 6f 69 63 65 20 |k if all| choice |
|000018c0| 6f 62 6a 65 63 74 73 20 | 6f 6e 20 61 20 73 63 72 |objects |on a scr|
|000018d0| 65 65 6e 20 68 61 76 65 | 0a 20 20 20 20 62 65 65 |een have|. bee|
|000018e0| 6e 20 73 65 6c 65 63 74 | 65 64 2c 20 73 6f 20 74 |n select|ed, so t|
|000018f0| 68 61 74 20 61 20 70 72 | 6f 67 72 61 6d 20 63 61 |hat a pr|ogram ca|
|00001900| 6e 20 67 6f 20 6f 6e 20 | 74 6f 20 74 68 65 20 6e |n go on |to the n|
|00001910| 65 78 74 20 70 61 67 65 | 20 6f 66 20 73 63 72 65 |ext page| of scre|
|00001920| 65 6e 2e 0a 20 20 20 20 | 49 66 20 61 20 70 72 65 |en.. |If a pre|
|00001930| 76 69 6f 75 73 20 73 65 | 6c 65 63 74 28 29 20 63 |vious se|lect() c|
|00001940| 61 6c 6c 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |all is r|eturned |
|00001950| 61 62 6e 6f 72 6d 61 6c | 6c 79 20 62 79 20 70 72 |abnormal|ly by pr|
|00001960| 65 73 73 69 6e 67 20 61 | 6e 20 45 53 43 20 6b 65 |essing a|n ESC ke|
|00001970| 79 2c 0a 20 20 20 20 74 | 68 69 73 20 66 75 6e 63 |y,. t|his func|
|00001980| 74 69 6f 6e 20 77 69 6c | 6c 20 72 65 74 75 72 6e |tion wil|l return|
|00001990| 20 46 41 4c 53 45 2e 20 | 53 68 6f 75 6c 64 20 74 | FALSE. |Should t|
|000019a0| 68 69 73 20 6f 63 63 75 | 72 2c 20 74 68 65 20 70 |his occu|r, the p|
|000019b0| 72 65 76 69 6f 75 73 20 | 0a 20 20 20 20 76 61 6c |revious |. val|
|000019c0| 75 65 2c 20 69 66 20 61 | 6e 79 2c 20 77 69 6c 6c |ue, if a|ny, will|
|000019d0| 20 61 6c 73 6f 20 62 65 | 20 6c 6f 73 74 2e 0a 0a | also be| lost...|
|000019e0| 5c 73 75 62 74 69 74 6c | 65 7b 56 69 72 74 75 61 |\subtitl|e{Virtua|
|000019f0| 6c 20 5c 5c 20 4f 70 65 | 72 61 74 69 6f 6e 73 7d |l \\ Ope|rations}|
|00001a00| 0a 0a 5c 66 75 6e 63 74 | 69 6f 6e 7b 76 6f 69 64 |..\funct|ion{void|
|00001a10| 20 61 63 74 69 6f 6e 28 | 69 6e 74 20 73 74 61 74 | action(|int stat|
|00001a20| 75 73 29 7d 0a 20 20 20 | 20 44 65 66 69 6e 65 73 |us)}. | Defines|
|00001a30| 20 74 68 65 20 62 65 68 | 61 76 69 6f 72 73 20 6f | the beh|aviors o|
|00001a40| 66 20 74 68 65 20 63 68 | 6f 69 63 65 20 6f 62 6a |f the ch|oice obj|
|00001a50| 65 63 74 20 77 68 65 6e | 20 61 20 63 68 6f 69 63 |ect when| a choic|
|00001a60| 65 20 68 61 6e 64 6c 65 | 72 0a 20 20 20 20 68 61 |e handle|r. ha|
|00001a70| 73 20 62 65 65 6e 20 62 | 6f 6e 64 65 64 20 74 6f |s been b|onded to|
|00001a80| 20 74 68 65 20 6f 62 6a | 65 63 74 2e 20 20 54 68 | the obj|ect. Th|
|00001a90| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 69 73 20 63 |is funct|ion is c|
|00001aa0| 61 6c 6c 65 64 20 62 79 | 20 74 68 65 0a 20 20 20 |alled by| the. |
|00001ab0| 20 65 76 65 6e 74 20 68 | 61 6e 64 6c 65 72 20 77 | event h|andler w|
|00001ac0| 68 65 6e 20 69 74 20 64 | 65 74 65 63 74 73 20 74 |hen it d|etects t|
|00001ad0| 68 61 74 20 74 68 65 20 | 63 68 6f 69 63 65 20 6f |hat the |choice o|
|00001ae0| 62 6a 65 63 74 20 68 61 | 73 20 62 65 65 6e 0a 20 |bject ha|s been. |
|00001af0| 20 20 20 73 65 6c 65 63 | 74 65 64 2e 20 20 54 68 | selec|ted. Th|
|00001b00| 65 20 64 65 66 61 75 6c | 74 20 61 63 74 69 6f 6e |e defaul|t action|
|00001b10| 20 69 73 20 74 6f 20 64 | 6f 20 6e 6f 74 68 69 6e | is to d|o nothin|
|00001b20| 67 20 69 66 20 6e 6f 20 | 63 68 6f 69 63 65 20 68 |g if no |choice h|
|00001b30| 61 6e 64 6c 65 72 0a 20 | 20 20 20 70 72 65 73 65 |andler. | prese|
|00001b40| 6e 74 73 2c 20 6f 74 68 | 65 72 77 69 73 65 2c 20 |nts, oth|erwise, |
|00001b50| 69 74 20 69 6e 76 6f 6b | 65 73 20 74 68 65 20 63 |it invok|es the c|
|00001b60| 68 6f 69 63 65 20 68 61 | 6e 64 6c 65 72 20 0a 20 |hoice ha|ndler . |
|00001b70| 20 20 20 61 6e 64 20 70 | 61 73 73 65 73 20 69 74 | and p|asses it|
|00001b80| 20 61 6c 6f 6e 67 20 77 | 69 74 68 20 74 68 65 20 | along w|ith the |
|00001b90| 63 75 72 72 65 6e 74 20 | 73 74 61 74 75 73 20 0a |current |status .|
|00001ba0| 20 20 20 20 28 77 68 61 | 74 65 76 65 72 20 68 61 | (wha|tever ha|
|00001bb0| 73 20 62 65 65 6e 20 72 | 65 74 75 72 6e 65 64 20 |s been r|eturned |
|00001bc0| 66 72 6f 6d 20 61 20 73 | 74 61 74 75 73 28 29 20 |from a s|tatus() |
|00001bd0| 63 61 6c 6c 29 2e 20 20 | 0a 20 20 20 20 44 6f 20 |call). |. Do |
|00001be0| 6e 6f 74 20 6d 6f 64 69 | 66 79 20 74 68 69 73 20 |not modi|fy this |
|00001bf0| 66 75 6e 63 74 69 6f 6e | 20 75 6e 6c 65 73 73 20 |function| unless |
|00001c00| 69 74 20 69 73 20 61 62 | 73 6f 6c 75 74 65 6c 79 |it is ab|solutely|
|00001c10| 20 6e 65 63 65 73 73 61 | 72 79 20 62 65 63 61 75 | necessa|ry becau|
|00001c20| 73 65 0a 20 20 20 20 69 | 74 20 72 65 64 65 66 69 |se. i|t redefi|
|00001c30| 6e 65 73 20 74 68 65 20 | 73 65 6d 61 6e 74 69 63 |nes the |semantic|
|00001c40| 73 20 6f 66 20 61 6c 6c | 20 63 68 6f 69 63 65 20 |s of all| choice |
|00001c50| 6f 62 6a 65 63 74 73 2e | 0a 0a 5c 66 75 6e 63 74 |objects.|..\funct|
|00001c60| 69 6f 6e 7b 76 6f 69 64 | 20 62 69 6e 64 28 76 6f |ion{void| bind(vo|
|00001c70| 69 64 20 5c 68 62 6f 78 | 7b 5c 72 6d 20 28 5c 2a |id \hbox|{\rm (\*|
|00001c80| 7b 5c 69 74 20 68 61 6e | 64 6c 65 72 7d 29 28 69 |{\it han|dler})(i|
|00001c90| 6e 74 29 7d 29 7d 0a 20 | 20 20 20 41 73 73 6f 63 |nt)})}. | Assoc|
|00001ca0| 69 61 74 65 73 20 61 20 | 63 68 6f 69 63 65 20 68 |iates a |choice h|
|00001cb0| 61 6e 64 6c 65 72 20 66 | 75 6e 63 74 69 6f 6e 20 |andler f|unction |
|00001cc0| 77 69 74 68 20 74 68 65 | 20 63 68 6f 69 63 65 20 |with the| choice |
|00001cd0| 6f 62 6a 65 63 74 2e 20 | 20 45 76 65 72 79 0a 20 |object. | Every. |
|00001ce0| 20 20 20 74 69 6d 65 20 | 74 68 69 73 20 63 68 6f | time |this cho|
|00001cf0| 69 63 65 20 6f 62 6a 65 | 63 74 20 69 73 20 69 6e |ice obje|ct is in|
|00001d00| 76 6f 6b 65 64 2c 20 74 | 68 65 20 63 68 6f 69 63 |voked, t|he choic|
|00001d10| 65 20 68 61 6e 64 6c 65 | 72 20 69 73 20 63 61 6c |e handle|r is cal|
|00001d20| 6c 65 64 0a 20 20 20 20 | 69 6d 6d 65 64 69 61 74 |led. |immediat|
|00001d30| 65 6c 79 2e 20 20 0a 20 | 20 20 20 54 68 65 20 68 |ely. . | The h|
|00001d40| 61 6e 64 6c 65 72 20 69 | 73 20 70 61 73 73 65 64 |andler i|s passed|
|00001d50| 20 61 6c 6f 6e 67 20 77 | 69 74 68 20 74 68 65 20 | along w|ith the |
|00001d60| 63 75 72 72 65 6e 74 20 | 22 73 74 61 74 75 73 22 |current |"status"|
|00001d70| 0a 20 20 20 20 28 72 65 | 74 75 72 6e 20 76 61 6c |. (re|turn val|
|00001d80| 75 65 20 6f 66 20 73 74 | 61 74 75 73 28 29 20 63 |ue of st|atus() c|
|00001d90| 61 6c 6c 29 20 61 73 20 | 69 74 73 20 61 72 67 75 |all) as |its argu|
|00001da0| 6d 65 6e 74 2e 20 54 68 | 65 20 64 65 66 61 75 6c |ment. Th|e defaul|
|00001db0| 74 20 0a 20 20 20 20 61 | 63 74 69 6f 6e 20 74 61 |t . a|ction ta|
|00001dc0| 6b 65 6e 20 62 79 20 74 | 68 65 20 65 76 65 6e 74 |ken by t|he event|
|00001dd0| 20 68 61 6e 64 6c 65 72 | 20 63 61 6e 20 62 65 20 | handler| can be |
|00001de0| 6d 6f 64 69 66 69 65 64 | 20 62 79 20 63 68 61 6e |modified| by chan|
|00001df0| 67 69 6e 67 0a 20 20 20 | 20 74 68 65 20 6e 65 78 |ging. | the nex|
|00001e00| 74 20 66 75 6e 63 74 69 | 6f 6e 20 61 63 74 69 6f |t functi|on actio|
|00001e10| 6e 28 29 2e 0a 0a 5c 66 | 75 6e 63 74 69 6f 6e 7b |n()...\f|unction{|
|00001e20| 42 6f 6f 6c 65 61 6e 20 | 69 73 53 65 6c 65 63 74 |Boolean |isSelect|
|00001e30| 65 64 28 50 6f 69 6e 74 | 20 63 75 72 73 6f 72 29 |ed(Point| cursor)|
|00001e40| 7d 0a 20 20 20 20 52 65 | 74 75 72 6e 73 20 54 52 |}. Re|turns TR|
|00001e50| 55 45 20 69 66 20 61 20 | 6c 65 67 61 6c 20 68 6f |UE if a |legal ho|
|00001e60| 74 20 6b 65 79 20 69 73 | 20 70 72 65 73 73 65 64 |t key is| pressed|
|00001e70| 20 66 6f 72 20 74 68 65 | 0a 20 20 20 20 74 68 65 | for the|. the|
|00001e80| 20 69 6e 64 69 63 61 74 | 65 64 20 63 68 6f 69 63 | indicat|ed choic|
|00001e90| 65 20 6f 62 6a 65 63 74 | 2e 20 49 74 20 61 6c 73 |e object|. It als|
|00001ea0| 6f 20 72 65 74 75 72 6e | 73 20 54 52 55 45 20 69 |o return|s TRUE i|
|00001eb0| 66 20 0a 20 20 20 20 61 | 20 6d 6f 75 73 65 20 62 |f . a| mouse b|
|00001ec0| 75 74 74 6f 6e 20 69 73 | 20 70 72 65 73 73 65 64 |utton is| pressed|
|00001ed0| 20 77 69 74 68 69 6e 20 | 74 68 65 20 72 61 6e 67 | within |the rang|
|00001ee0| 65 20 6f 66 20 74 68 65 | 20 63 68 6f 69 63 65 20 |e of the| choice |
|00001ef0| 6f 62 6a 65 63 74 20 61 | 72 65 61 2e 0a 20 20 20 |object a|rea.. |
|00001f00| 20 54 68 69 73 20 63 61 | 6c 6c 20 69 73 20 75 73 | This ca|ll is us|
|00001f10| 65 64 20 62 79 20 74 68 | 65 20 65 76 65 6e 74 20 |ed by th|e event |
|00001f20| 68 61 6e 64 6c 65 72 20 | 74 6f 20 63 68 65 63 6b |handler |to check|
|00001f30| 20 69 66 20 74 68 69 73 | 20 63 68 6f 69 63 65 20 | if this| choice |
|00001f40| 6f 62 6a 65 63 74 0a 20 | 20 20 20 68 61 73 20 62 |object. | has b|
|00001f50| 65 65 6e 20 73 65 6c 65 | 63 74 65 64 2e 20 20 49 |een sele|cted. I|
|00001f60| 74 20 69 73 20 68 61 72 | 64 6c 79 20 6e 65 65 64 |t is har|dly need|
|00001f70| 65 64 20 69 6e 20 72 65 | 67 75 6c 61 72 20 61 70 |ed in re|gular ap|
|00001f80| 70 6c 69 63 61 74 69 6f | 6e 73 2e 0a 20 20 20 20 |plicatio|ns.. |
|00001f90| 54 68 65 20 22 63 75 72 | 73 6f 72 22 20 69 73 20 |The "cur|sor" is |
|00001fa0| 66 6f 72 20 6d 6f 75 73 | 65 20 63 75 72 73 6f 72 |for mous|e cursor|
|00001fb0| 20 69 6e 20 6d 6f 75 73 | 65 20 6d 6f 64 65 20 6f | in mous|e mode o|
|00001fc0| 72 20 66 61 6b 65 64 20 | 77 69 74 68 20 74 68 65 |r faked |with the|
|00001fd0| 0a 20 20 20 20 63 75 72 | 72 65 6e 74 20 6b 65 79 |. cur|rent key|
|00001fe0| 62 6f 61 72 64 20 69 6e | 70 75 74 20 61 73 20 74 |board in|put as t|
|00001ff0| 68 65 20 63 75 72 73 6f | 72 27 73 20 78 20 63 6f |he curso|r's x co|
|00002000| 6f 72 64 69 6e 61 74 65 | 2e 0a 0a 5c 73 75 62 74 |ordinate|...\subt|
|00002010| 69 74 6c 65 7b 53 65 65 | 20 41 6c 73 6f 7d 0a 20 |itle{See| Also}. |
|00002020| 20 20 20 20 45 76 65 6e | 74 2c 20 42 75 74 74 6f | Even|t, Butto|
|00002030| 6e 2c 20 42 6f 78 0a 0a | 5c 73 75 62 74 69 74 6c |n, Box..|\subtitl|
|00002040| 65 7b 41 75 74 68 6f 72 | 7d 0a 20 20 20 20 52 6f |e{Author|}. Ro|
|00002050| 6e 20 43 68 65 6e 20 61 | 74 20 74 68 65 20 4f 66 |n Chen a|t the Of|
|00002060| 66 69 63 65 20 66 6f 72 | 20 49 6e 66 6f 72 6d 61 |fice for| Informa|
|00002070| 74 69 6f 6e 20 4d 61 6e | 61 67 65 6d 65 6e 74 2c |tion Man|agement,|
|00002080| 20 55 49 55 43 2e 20 39 | 2d 31 2d 38 39 2e 0a 0a | UIUC. 9|-1-89...|
|00002090| 5c 65 6e 64 7b 6d 61 6e | 70 61 67 65 7d 0a 5c 6e |\end{man|page}.\n|
|000020a0| 65 77 70 61 67 65 0a 5c | 62 65 67 69 6e 7b 76 65 |ewpage.\|begin{ve|
|000020b0| 72 62 61 74 69 6d 7d 0a | 20 20 20 20 2f 2a 20 45 |rbatim}.| /* E|
|000020c0| 58 41 4d 50 4c 45 20 32 | 20 2a 2f 0a 20 20 20 20 |XAMPLE 2| */. |
|000020d0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 6c 69 62 |#include| <stdlib|
|000020e0| 2e 68 3e 0a 20 20 20 20 | 23 69 6e 63 6c 75 64 65 |.h>. |#include|
|000020f0| 20 22 63 68 6f 69 63 65 | 2e 68 22 0a 0a 20 20 20 | "choice|.h".. |
|00002100| 20 76 6f 69 64 20 68 61 | 6e 64 6c 65 72 31 28 69 | void ha|ndler1(i|
|00002110| 6e 74 20 70 69 63 6b 29 | 20 7b 0a 20 20 20 20 20 |nt pick)| {. |
|00002120| 20 20 20 42 6f 78 20 62 | 6f 78 28 35 30 30 2c 20 | Box b|ox(500, |
|00002130| 33 30 2c 20 36 30 30 2c | 20 36 30 2c 20 4c 49 47 |30, 600,| 60, LIG|
|00002140| 48 54 5f 43 59 41 4e 2c | 20 4c 49 47 48 54 5f 4d |HT_CYAN,| LIGHT_M|
|00002150| 41 47 45 4e 54 41 29 3b | 0a 20 20 20 20 20 20 20 |AGENTA);|. |
|00002160| 20 62 6f 78 20 3c 3c 20 | 70 69 63 6b 20 2b 20 31 | box << |pick + 1|
|00002170| 3b 0a 20 20 20 20 7d 0a | 0a 20 20 20 20 76 6f 69 |;. }.|. voi|
|00002180| 64 20 68 61 6e 64 6c 65 | 72 32 28 69 6e 74 20 70 |d handle|r2(int p|
|00002190| 69 63 6b 29 20 7b 0a 20 | 20 20 20 20 20 20 20 42 |ick) {. | B|
|000021a0| 6f 78 20 62 6f 78 28 35 | 30 30 2c 20 33 30 2c 20 |ox box(5|00, 30, |
|000021b0| 36 30 30 2c 20 36 30 2c | 20 4c 49 47 48 54 5f 43 |600, 60,| LIGHT_C|
|000021c0| 59 41 4e 2c 20 4c 49 47 | 48 54 5f 4d 41 47 45 4e |YAN, LIG|HT_MAGEN|
|000021d0| 54 41 29 3b 0a 20 20 20 | 20 20 20 20 20 62 6f 78 |TA);. | box|
|000021e0| 20 3c 3c 20 28 70 69 63 | 6b 3d 3d 30 20 3f 20 22 | << (pic|k==0 ? "|
|000021f0| 41 70 65 22 20 3a 20 28 | 70 69 63 6b 3d 3d 31 20 |Ape" : (|pick==1 |
|00002200| 3f 20 22 42 6f 62 22 20 | 3a 20 22 43 61 72 22 29 |? "Bob" |: "Car")|
|00002210| 29 3b 0a 20 20 20 20 7d | 0a 0a 20 20 20 20 76 6f |);. }|.. vo|
|00002220| 69 64 20 68 61 6e 64 6c | 65 72 33 28 69 6e 74 20 |id handl|er3(int |
|00002230| 70 69 63 6b 29 20 7b 0a | 20 20 20 20 20 20 20 20 |pick) {.| |
|00002240| 42 6f 78 20 62 6f 78 28 | 35 30 30 2c 20 33 30 2c |Box box(|500, 30,|
|00002250| 20 36 30 30 2c 20 36 30 | 2c 20 4c 49 47 48 54 5f | 600, 60|, LIGHT_|
|00002260| 43 59 41 4e 2c 20 4c 49 | 47 48 54 5f 4d 41 47 45 |CYAN, LI|GHT_MAGE|
|00002270| 4e 54 41 29 3b 0a 20 20 | 20 20 20 20 20 20 73 77 |NTA);. | sw|
|00002280| 69 74 63 68 20 28 70 69 | 63 6b 29 20 7b 0a 20 20 |itch (pi|ck) {. |
|00002290| 20 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 30 | | case 0|
|000022a0| 3a 20 62 6f 78 20 3c 3c | 20 22 44 22 3b 20 62 72 |: box <<| "D"; br|
|000022b0| 65 61 6b 3b 20 63 61 73 | 65 20 31 3a 20 62 6f 78 |eak; cas|e 1: box|
|000022c0| 20 3c 3c 20 22 45 22 3b | 20 62 72 65 61 6b 3b 0a | << "E";| break;.|
|000022d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|000022e0| 20 32 3a 20 62 6f 78 20 | 3c 3c 20 22 46 22 3b 20 | 2: box |<< "F"; |
|000022f0| 62 72 65 61 6b 3b 20 63 | 61 73 65 20 33 3a 20 62 |break; c|ase 3: b|
|00002300| 6f 78 20 3c 3c 20 22 47 | 22 3b 20 62 72 65 61 6b |ox << "G|"; break|
|00002310| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 63 61 |;. | ca|
|00002320| 73 65 20 34 3a 20 65 78 | 69 74 28 30 29 3b 0a 20 |se 4: ex|it(0);. |
|00002330| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 7d 0a 0a | }|. }..|
|00002340| 20 20 20 20 6d 61 69 6e | 28 29 20 7b 0a 20 20 20 | main|() {. |
|00002350| 20 20 20 20 20 50 6f 69 | 6e 74 20 61 28 31 30 30 | Poi|nt a(100|
|00002360| 2c 20 31 30 30 29 2c 20 | 62 28 32 32 30 2c 20 31 |, 100), |b(220, 1|
|00002370| 33 30 29 3b 0a 20 20 20 | 20 20 20 20 20 43 68 6f |30);. | Cho|
|00002380| 69 63 65 20 63 31 28 61 | 2c 20 62 2c 20 42 52 4f |ice c1(a|, b, BRO|
|00002390| 57 4e 2c 20 52 45 44 2c | 20 4f 4e 5f 42 4f 52 44 |WN, RED,| ON_BORD|
|000023a0| 45 52 2c 20 30 2c 20 34 | 2c 0a 20 20 20 20 20 20 |ER, 0, 4|,. |
|000023b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000023c0| 20 22 40 31 40 22 2c 20 | 22 40 32 40 22 2c 20 22 | "@1@", |"@2@", "|
|000023d0| 40 33 40 22 2c 20 22 40 | 34 40 22 29 3b 0a 20 20 |@3@", "@|4@");. |
|000023e0| 20 20 20 20 20 20 43 68 | 6f 69 63 65 20 63 32 28 | Ch|oice c2(|
|000023f0| 33 2c 20 48 4f 52 49 5a | 4f 4e 54 41 4c 29 3b 0a |3, HORIZ|ONTAL);.|
|00002400| 20 20 20 20 20 20 20 20 | 63 32 2e 61 64 64 49 74 | |c2.addIt|
|00002410| 65 6d 28 50 6f 69 6e 74 | 28 32 30 30 2c 20 32 30 |em(Point|(200, 20|
|00002420| 30 29 2c 20 50 6f 69 6e | 74 28 32 36 30 2c 32 33 |0), Poin|t(260,23|
|00002430| 30 29 2c 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |0),. | |
|00002440| 20 20 20 20 20 20 20 57 | 48 49 54 45 2c 20 42 4c | W|HITE, BL|
|00002450| 55 45 2c 20 49 4e 5f 42 | 4f 52 44 45 52 2c 20 22 |UE, IN_B|ORDER, "|
|00002460| 40 41 40 70 65 22 29 3b | 0a 20 20 20 20 20 20 20 |@A@pe");|. |
|00002470| 20 63 32 2e 61 64 64 49 | 74 65 6d 28 50 6f 69 6e | c2.addI|tem(Poin|
|00002480| 74 28 32 37 30 2c 20 32 | 30 30 29 2c 20 50 6f 69 |t(270, 2|00), Poi|
|00002490| 6e 74 28 33 33 30 2c 32 | 33 30 29 2c 0a 20 20 20 |nt(330,2|30),. |
|000024a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024b0| 57 48 49 54 45 2c 20 42 | 4c 55 45 2c 20 49 4e 5f |WHITE, B|LUE, IN_|
|000024c0| 42 4f 52 44 45 52 2c 20 | 22 40 42 40 6f 62 22 29 |BORDER, |"@B@ob")|
|000024d0| 3b 0a 20 20 20 20 20 20 | 20 20 63 32 2e 61 64 64 |;. | c2.add|
|000024e0| 49 74 65 6d 28 50 6f 69 | 6e 74 28 33 34 30 2c 20 |Item(Poi|nt(340, |
|000024f0| 32 30 30 29 2c 20 50 6f | 69 6e 74 28 34 30 30 2c |200), Po|int(400,|
|00002500| 32 33 30 29 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |230),. | |
|00002510| 20 20 20 20 20 20 20 20 | 20 57 48 49 54 45 2c 20 | | WHITE, |
|00002520| 42 4c 55 45 2c 20 49 4e | 5f 42 4f 52 44 45 52 2c |BLUE, IN|_BORDER,|
|00002530| 20 22 40 43 40 61 72 22 | 29 3b 0a 20 20 20 20 20 | "@C@ar"|);. |
|00002540| 20 20 20 61 20 3d 20 50 | 6f 69 6e 74 28 35 30 30 | a = P|oint(500|
|00002550| 2c 20 32 33 30 29 3b 20 | 62 20 3d 20 50 6f 69 6e |, 230); |b = Poin|
|00002560| 74 28 35 35 30 2c 20 33 | 33 30 29 3b 0a 20 20 20 |t(550, 3|30);. |
|00002570| 20 20 20 20 20 43 68 6f | 69 63 65 20 63 33 28 61 | Cho|ice c3(a|
|00002580| 2c 20 62 2c 20 47 52 45 | 45 4e 2c 20 47 52 41 59 |, b, GRE|EN, GRAY|
|00002590| 2c 20 4e 4f 5f 42 4f 52 | 44 45 52 2c 20 31 30 2c |, NO_BOR|DER, 10,|
|000025a0| 20 35 2c 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | 5,. | |
|000025b0| 20 20 20 20 20 20 20 20 | 20 20 20 22 40 44 40 22 | | "@D@"|
|000025c0| 2c 20 22 40 45 40 22 2c | 20 22 40 46 40 22 2c 20 |, "@E@",| "@F@", |
|000025d0| 22 40 47 40 22 2c 20 22 | 40 48 40 22 29 3b 0a 20 |"@G@", "|@H@");. |
|000025e0| 20 20 20 20 20 20 20 63 | 31 2e 62 69 6e 64 28 68 | c|1.bind(h|
|000025f0| 61 6e 64 6c 65 72 31 29 | 3b 0a 20 20 20 20 20 20 |andler1)|;. |
|00002600| 20 20 63 32 2e 62 69 6e | 64 28 68 61 6e 64 6c 65 | c2.bin|d(handle|
|00002610| 72 32 29 3b 0a 20 20 20 | 20 20 20 20 20 63 33 2e |r2);. | c3.|
|00002620| 62 69 6e 64 28 68 61 6e | 64 6c 65 72 33 29 3b 0a |bind(han|dler3);.|
|00002630| 20 20 20 20 20 20 20 20 | 45 76 65 6e 74 3a 3a 77 | |Event::w|
|00002640| 61 69 74 46 6f 72 45 76 | 65 6e 74 73 28 29 3b 0a |aitForEv|ents();.|
|00002650| 20 20 20 20 7d 0a 5c 65 | 6e 64 7b 76 65 72 62 61 | }.\e|nd{verba|
|00002660| 74 69 6d 7d 0a 0a 5c 65 | 6e 64 7b 64 6f 63 75 6d |tim}..\e|nd{docum|
|00002670| 65 6e 74 7d 0a | |ent}. | |
+--------+-------------------------+-------------------------+--------+--------+